package com.itguigu.spzx.common.config;

import com.itguigu.spzx.common.interceptor.UserInfoInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author lxr
 * @date 2025/10/21 20:01
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    @Autowired
    UserInfoInterceptor userInfoInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(userInfoInterceptor)
                .addPathPatterns("/**");
    }
}
